﻿using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AnesSystem
{
  public class ObejectFactory
    {
        public static T CtreatObject<T>()
        {
            Type type = Type.GetType(HospitalConfig.Instance.CurrentHospital.ModelNameSpace + "." + typeof(T).Name);
            if (type != null)
            {
                return (T)Activator.CreateInstance(type);
            }
            else
            {
                return (T)Activator.CreateInstance<T>();
            }
        }
    }
}
